using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class ShowingTheNewEquip : MonoBehaviour
{
	public static ShowingTheNewEquip instance;

	public Image IMG_Equip;

	public TextMeshProUGUI[] TXT_ShowingTheNewEquip;

	public Button btn;

	private void Awake()
	{
		instance = this;
	}

	public void Show(string kind, Sprite spr, string equipName, string equipType)
	{
		btn.interactable = false;
		IMG_Equip.sprite = spr;
		if (kind == "Cloak")
		{
			IMG_Equip.color = VariousInfo.cloakInfo[PlayerPrefs.GetInt("currentUnlockedCloakNumber") + 1].c;
		}
		else
		{
			IMG_Equip.color = new Color(1f, 1f, 1f);
		}
		TXT_ShowingTheNewEquip[0].text = equipName;
		TXT_ShowingTheNewEquip[1].text = equipType;
		Audio.instance.ui[1].Play();
		StartCoroutine(IE_ButtonActiveTimer());
	}

	private IEnumerator IE_ButtonActiveTimer()
	{
		yield return new WaitForSecondsRealtime(1f);
		btn.interactable = true;
	}

	public void BTN_TouchedShowingTheNewEquip()
	{
		base.gameObject.SetActive(false);
		GM.instance.CheckMoreUnlockingEquips();
	}
}
